//
//  ViewController.m
//  06---Homework第二题
//
//  Created by 冀永金 on 16/7/21.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self config];
    // Do any additional setup after loading the view, typically from a nib.
}
- (void)config {
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.13 green:0.72 blue:0.95 alpha:1.00];
    UISegmentedControl *segment = [[UISegmentedControl alloc]initWithItems:@[@"消息 ",@"电话"]];
    segment.frame = CGRectMake(0, 0, 200, 40);
    self.navigationItem.titleView = segment;
    [segment setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont systemFontOfSize:22]} forState:UIControlStateNormal];
    segment.tintColor = [UIColor whiteColor];
    UIImage *image = [UIImage imageNamed:@"23"];
    UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:imageView];
    imageView.frame = CGRectMake(0, 0, 40, 40);
    imageView.layer.cornerRadius = 20;
    imageView.clipsToBounds = YES;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
